package com.gdcvi.scan;

/**
 * PlayerDecorator:玩家装饰器
 */
public abstract class PlayerDecorator extends Player{
    private Player player;

    public PlayerDecorator(Player player) {
        this.player = player;
    }

    public Player getPlayer() {
        return player;
    }

    public void setPlayer(Player player) {
        this.player = player;
    }
    @Override
    public String getName() {
        return getPlayer().getName();
    }

    @Override
    public void setName(String name) {
        getPlayer().setName(name);
    }

    @Override
    public String toString() {
        return ""+player;
    }
}
